package cheme.ProcessModel.ProcessUnits;

import java.util.List;

import cheme.ProcessModel.IBoundedTranslatable;
import cheme.ProcessModel.IChild;
import cheme.ProcessModel.ProcessUnits.Streams.AbstractStream;


public interface IProcessUnit extends IBoundedTranslatable
{
	String getText();
	void setText(String text);
	
	/*--------------------------------------------------------------------------
	 * Source/out stream methods
	 */
	
	/**
	 * Adds an Stream instance for which <b>this IProcessUnit is a source</b>.
	 * @param source
	 */
	void addOutStream(AbstractStream stream);
	
	/**
	 * Removes an Stream instance for which <b>this IProcessUnit is a source</b>.
	 * @param source
	 */
	void removeOutStream(AbstractStream stream);
	
	/**
	 * Gets a List<Stream> of IStream for which <b>this IProcessUnit is a source</b>.
	 * @return List<Stream>
	 */
	List<IChild> getOutStreams();
	
	/*--------------------------------------------------------------------------
	 * Sink/in stream methods
	 */
	
	/**
	 * Adds an Stream instance for which <b>this IProcessUnit is a sink</b>.
	 * @param source
	 */
	void addInStream(AbstractStream stream);

	/**
	 * Removes an Stream instance for which <b>this IProcessUnit is a sink</b>.
	 * @param source
	 */
	void removeInStream(AbstractStream stream);

	/**
	 * Gets a List<Stream> of IStream for which <b>this IProcessUnit is a sink</b>.
	 * @return List<Stream>
	 */
	List<IChild> getInStreams();
	
	static final int UNLIMITED = -1;
	boolean willAcceptInStream();
	boolean willAcceptOutStream();
	boolean willAcceptOutStream(int additionalStreamCount);
	boolean willAcceptInStream(int additionalStreamCount);
}